#if !defined(_DAEMON_SUB_PROCESS)
#define _DAEMON_SUB_PROCESS

#define MAX_FAILED_COUNT 5
#define EXE_NAME "/usr/bin/gateway"

typedef struct {
    int pid;
    char *sub_cmd;
    int failed_count;

} SubProcess ;

/**
 * 初始化子进程 
 * 
 */
SubProcess  *sub_process_init(char *sub_cmd );


/**
 * 检查并启动子进程
 */
int sub_process_check_and_start(SubProcess *sub_process);

/**
 * 停止子进程
 */

int sub_process_stop(SubProcess *sub_process);

#endif // _DAEMON_SUB_PROCESS
